package lianliankan.FunctionBlock;

import java.applet.Applet;
import java.applet.AudioClip;
import java.net.MalformedURLException;
import java.net.URL;


public class PlayMusic implements Runnable{

	private URL url = null;

	
	public PlayMusic() {
		try {
			url = new URL("file:/"+System.getProperty("user.dir")+"/music/earse.wav");
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
	}

	public void run() {
		AudioClip audio = Applet.newAudioClip(url);
		audio.play();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
